import sqlite3

conn = sqlite3.connect("../book.db")
cursor = conn.cursor()

#insert_sql = "insert into sys_user(id,name,age) values (?,?)"
#cursor.execute(insert_sql,parameters:(1,"root2",18))
#cursor.execute(insert_sql,parameters:(1,"root3",18))
#cursor.execute(insert_sql,parameters:(1,"root4",18))
#conn.commit()


select_sql = "select * from sys_user where id=?"
#cursor.execute(select_sql)
#for row in cursor:
 #   print(row)

 cursor.execute(select_sql)
 result = cursor.fetchone()
 print(result)

 update_sql = "update sys_user set name=? where id=?"
 cursor.execute(update_sql, ("admin",1))
conn.commit()


delect_sql = "select * from sys_user where id=?"
cursor.execute(delect_sql,(4,))
conn.commit()

cursor.execute("select * from sys_user where id=?",(4,))
result = cursor.fetchone()
for row in result:
    print(row)
cursor.close()
conn.close()